package com.cloudkinto.service.company;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.vo.company.CompanyPageVo;
import com.cloudkinto.entity.CompanyDo;
import com.cloudkinto.vo.company.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author 张永远
 * @since 2020-05-27
 */
public interface CompanyService extends IService<CompanyDo> {

    SingleResult addInit();


    SingleResult updateInit(Long id);

    Object update(CompanyUpdateReq updateVo, Long tenantId, Long userId);

    int delete(Long id, Long userId);

    CompanyDetailRes detail(Long id, Long userId, Long tenantId, String source);

    SingleResult pageInit();

//    List<Map<String, Object>> getList(Long tenantId);

    /**
     * 无视权限获取 tenantId下 所有客户列表
     *
     * @param map
     * @return
     */
    List<CompanyPageVo> getListNoPower(Map<String, Object> map);

    List<CompanyPageVo> getList(Map<String, Object> map);

    PageResult getListPage(Map<String, Object> map);

    List<Map> getInitList(Long companyId);

    List<CompanyRes> getCompanyList(Long userId, Long tenantId, String source);

    void addCompany(CompanyAddReq req, Long tenantId, Long userId, boolean needCheck);

    void setStorage(CompanySetStorageReq req, Long tenantId, Long userId);

    void productFreeTrial(ProductFreeTrialReq req, Long userId);

    void updateStatus(UpdateStatusReq req, Long userId);

    void resetPassword(ResetPasswordReq req, Long userId);

    void templateDownload(Long tenantId, HttpServletResponse response);

    CompanyImportRes templateImport(MultipartFile file, Long tenantId, Long userId);

    void companyExport(Map<String, Object> map, HttpServletResponse response);

    String getTokenForOms(TokenForOmsReq req, HttpServletRequest request, Long userId);
}
